<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>CodeMirror</title>
	<link rel="stylesheet" type="text/css" href="css/docs.css"/>
	<script type="text/javascript" src="js/codemirror.js"></script>
	<script type="text/javascript">
		var html = {
			parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
			autoMatchParens: true
		};
		var xml = {
			parserfile: "parsexml.js"
		};
		var js = {
			parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
			autoMatchParens: true
		};
		var css = {
			parserfile: "parsecss.js"
		};
		var sparql = {
			parserfile: "parsesparql.js"
		};
		var lua = {
			parserfile: "parselua.js"
		};
		var php = {
			parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "tokenizephp.js", "parsephp.js", "parsephphtmlmixed.js"],
			continuousScanning: 500
		};
		var python = {
			parserfile: ["parsepython.js"],
			textWrapping: false,
			indentUnit: 4,
			parserConfig: {
				'pythonVersion': 2,
				'strictErrors': true
			}
		};
		var sql = {
			parserfile: "parsesql.js",
			textWrapping: false
		};
		var dummy = {
			parserfile: "parsedummy.js"
		};
	</script>
</head>

<body>
<p>Choose syntax:
	<select id="syntax">
		<option value="html">html, mixed</option>
		<option value="xml">xml</option>
		<option value="js">javascript</option>
		<option value="css">css</option>
		<option value="lua">lua</option>
		<option value="php">php, mixed</option>
		<option value="python">python</option>
		<option value="sparql">sparql</option>
		<option value="sql">sql</option>
		<option value="dummy" selected="selected">text</option>
	</select>
	paste code, or type inside the area. Highlighting by
	<strong><a href="http://marijn.haverbeke.nl/codemirror/">CodeMirror</a></strong>.
</p>

<div class="border">
	<textarea id="code" style="display: none;" cols="120" rows="20"></textarea>
</div>
<script type="text/javascript">
	var menu = document.getElementById("syntax");
	menu.disabled = false;
	menu.onchange=function() {
		var chosen = this.options[this.selectedIndex];
		var settings = eval(chosen.value);
		settings.path = 'js/';
		settings.height = '240px';
		settings.lineNumbers = true;
		settings.stylesheet = "css/docs.css";
		var editor = CodeMirror.fromTextArea('code', settings);
		this.disabled = true;
	}
</script>
</body>
</html>
